
var yahooMapLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    tileSize: 512,
    url:'https://{0-3}.base.maps.api.here.com/maptile/2.1/maptile/newest/normal.day/{z}/{x}/{y}/512/png8?lg=ENG&ppi=250&token=TrLJuXVK62IQk0vuXFzaig%3D%3D&requestid=yahoo.prod&app_id=eAdkWGYRoc4RfxVo0Z4B'
  })
});


var openStreetMapLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url: 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'
  })
});

var googleMapLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url:'http://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i345013117!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0'
  })
});

var gaodeMapLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url:'http://webst0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}'
  })
});

var bingMapLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    tilePixelRatio: 2,
    tileUrlFunction: function(tileCoord){
      var z = tileCoord[0];
      var x = tileCoord[1];
      var y = -tileCoord[2] - 1;
      var result='', zIndex=0;

      for(; zIndex<z; zIndex++) {
        result = ((x&1)+2*(y&1)).toString() + result;
        x >>= 1;
        y >>= 1;
      }
      return 'http://dynamic.t0.tiles.ditu.live.com/comp/ch/' + result + '?it=G,VE,BX,L,LA&mkt=zh-cn,syr&n=z&og=111&ur=CN';
    }
  })
});

